/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', sans-serif;
}

/* 容器布局 */
.container {
    display: flex;
    min-height: 100vh;
}

/* 侧边导航栏 */
.sidebar {
    width: 80px;
    background: #2c3e50;
    padding: 20px 0;
    transition: width 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.nav-item {
    color: #ecf0f1;
    padding: 15px;
    margin: 10px 0;
    cursor: pointer;
    text-align: center;
    width: 100%;
    transition: background 0.3s;
}

.nav-item:hover {
    background: #34495e;
}

.nav-item i {
    font-size: 24px;
    display: block;
    margin-bottom: 5px;
}

.nav-item span {
    font-size: 12px;
    display: none;
}

/* 内容区域 */
.content {
    flex: 1;
    padding: 30px 40px;
    background: #f5f2eb;
}

@media (max-width: 768px) {
    .translation-box {
        grid-template-columns: 1fr;
        padding: 15px;
    }

    textarea {
        height: 200px;
        font-size: 16px;
    }

    .annotation-sidebar {
        margin-top: 20px;
    }
}

.error-border {
    border-color: #c53030 !important;
    animation: shake 0.5s;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(8px);
    }

    75% {
        transform: translateX(-8px);
    }
}

.error-message {
    color: #c53030;
    padding: 12px;
    background: #fff5f5;
    border-radius: 6px;
    margin: 10px 0;
    border: 1px solid #fed7d7;
}

.translation-box {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 输入输出区域 */
textarea {
    width: 100%;
    height: 300px;
    padding: 20px;
    border: 2px solid #3a5f7d;
    border-radius: 12px;
    font-size: 17px;
    line-height: 1.8;
    resize: vertical;
    background: #f8f5e6;
    font-family: '华文楷体', 'Microsoft YaHei';
    transition: all 0.3s ease;
}

textarea:focus {
    border-color: #5d8aa8;
    box-shadow: 0 0 10px rgba(93, 138, 168, 0.3);
}

button {
    background: linear-gradient(135deg, #3a5f7d 0%, #5d8aa8 100%);
    color: white;
    padding: 14px 32px;
    border: 1px solid #5d8aa8;
    border-radius: 8px;
    cursor: pointer;
    margin: 15px 0;
    font-size: 16px;
    letter-spacing: 1px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

button.loading {
    position: relative;
    color: transparent;
}

button.loading::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

button:hover {
    background: #2980b9;
}

.annotation-sidebar {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(58, 95, 125, 0.1);
    border: 1px solid #e0d6c3;
}

.annotation-sidebar h3 {
    color: #3a5f7d;
    margin-bottom: 15px;
    font-size: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0d6c3;
}

#historical-context p {
    padding: 12px;
    background: #f8f5e6;
    border-radius: 6px;
    margin: 8px 0;
    font-size: 14px;
}

#translation-result {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 12px;
    min-height: 320px;
    margin: 20px 0;
    border: 1px solid #e0d6c3;
    box-shadow: 0 4px 15px rgba(58, 95, 125, 0.1);
}

.translation-text {
    display: block;
    font-size: 17px;
    line-height: 1.8;
    color: #2c3e50;
}

.analysis-section {
    background: #f8f5e6;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #5d8aa8;
}

.analysis-section h4 {
    color: #3a5f7d;
    margin-bottom: 15px;
    font-size: 16px;
}

/* 练习区域分栏样式 */
.exercise-container {
    display: flex;
    gap: 20px;
    height: calc(100vh - 120px);
    align-items: stretch;
}

.split-layout {
    grid-template-columns: 300px 1fr;
    gap: 30px;
}

.split-layout .article-column {
    width: 300px;
    overflow: hidden;
}

.split-layout .content-column {
    grid-column: 2 / -1;
    width: 600px;
    height: calc(100vh - 150px);
    overflow: auto;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* 练习区域现代样式 */
:root {
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.exercise-area {
    background: var(--primary-gradient);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.split-layout {
    gap: 40px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
}

.processed-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #374151;
}

.blank input {
    border: 2px solid #e5e7eb;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 8px 12px;
    border-radius: 8px;
}

.blank input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.check-btn {
    background: var(--primary-gradient);
    transition: transform 0.2s, box-shadow 0.2s;
    letter-spacing: 1px;
}

.check-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.answer-container {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.answer-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px 24px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    max-height: 60vh;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .answer-list {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

.answer-container {
    margin-top: 20px;
    border-top: 2px solid #e9ecef;
    padding-top: 15px;
}